try:
    from PyQt5.QtGui import *
    from PyQt5.QtCore import *
    from PyQt5.QtWidgets import *
except ImportError:
    from PyQt4.QtGui import *
    from PyQt4.QtCore import *

from PyQt5 import QtCore
class MyModel(QAbstractItemModel):
    def __init__(self, data, parent=None):
        super().__init__(parent)
        self.data = []
        for k , v in data.items() :
            self.data.append([k,v])
        # self.data = data

    def rowCount(self, parent=QModelIndex()) -> int:
        return len(self.data)

    def columnCount(self, parent=QModelIndex()) -> int:
        # for _ , v in self.data.items() :
        #     return len(v)
        return  len(self.data[0])

    def index(self, row, column, parent=QModelIndex()) -> QModelIndex:
        return QModelIndex()

    def data(self, index, role=QtCore.Qt.DisplayRole):
        if role == QtCore.Qt.DisplayRole:
            return self.data[index.row()][index.column()]

def Format_KV(k,v) -> str :
    w = 10
    v = str(v)
    k = str(k)
    return k.ljust(w) + " : " +  v